﻿namespace Calculator.Expression.Atom
{
    using System;
    using ExpressionEvaluator;
    using ExpressionEvaluator.Expression;
    public class Identifier : Expr
    {
        private string name;

        public Identifier(string name)
        {
            this.name = name;
        }

        public Identifier(string name, Expr expr)
        {
            this.name = name;
            base.Value = expr.Value;
        }

        public override Expr diff(Expr expr)
        {
            return new Constant(1);
        }

        public override string Name
        {
            get { return name; }
        }
    }
}
